package com.jkgj.skykingkong.tms.infrastructure.security;

import io.ebean.config.CurrentUserProvider;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author Xuegui Yuan
 */
public class SecurityUserProvider implements CurrentUserProvider {
  @Override
  public Object currentUser() {
    if(SecurityContextHolder.getContext().getAuthentication() == null){
      return "";
    }
    return SecurityContextHolder.getContext().getAuthentication().getName();
  }
}
